package com.vnp.vchat.version2;

import com.vnp.vchat.MainActivity;
import com.vnp.vchat.R;
import com.vnp.vchat.R.anim;
import com.vnp.vchat.R.id;
import com.vnp.vchat.R.layout;
import com.vnp.vchat.Util.Utils;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class CaidatmoiActivity extends Activity implements OnClickListener{
	
	TextView title;
	
	TextView titleThongtin, titleThongbao, titleHienthi, titleChung;
	
	RelativeLayout rlThongtin, rlThongbao, rlHienthi, rlChung;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_caidatmoi);
		
		title = (TextView)findViewById(R.id.title);
		titleThongtin = (TextView) findViewById(R.id.title_thongtincanhan);
		titleThongbao = (TextView) findViewById(R.id.title_thongbao);
		titleHienthi = (TextView) findViewById(R.id.title_hienthi);
		titleChung = (TextView) findViewById(R.id.title_chung);
		
		rlThongtin = (RelativeLayout) findViewById(R.id.rl_thongtin);
		rlThongbao = (RelativeLayout) findViewById(R.id.rl_thongbao);
		rlHienthi = (RelativeLayout) findViewById(R.id.rl_hienthi);
		rlChung = (RelativeLayout) findViewById(R.id.rl_chung);
		
		init();
		setFont();
	}
	
	void init(){
		title.setText("Cài đặt");
		rlThongtin.setOnClickListener(this);
		rlThongbao.setOnClickListener(this);
		rlHienthi.setOnClickListener(this);
		rlChung.setOnClickListener(this);
	}
	
	void setFont(){
		title.setTypeface(Utils.getTypefaceBold(CaidatmoiActivity.this));
		titleThongtin.setTypeface(Utils.getTypefaceRegular(CaidatmoiActivity.this));
		titleThongbao.setTypeface(Utils.getTypefaceRegular(CaidatmoiActivity.this));
		titleHienthi.setTypeface(Utils.getTypefaceRegular(CaidatmoiActivity.this));
		titleChung.setTypeface(Utils.getTypefaceRegular(CaidatmoiActivity.this));
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.rl_thongtin:
			gotoCaidatThongtinCanhan();
			break;
		case R.id.rl_thongbao:
			gotoCaidatThongbao();
			break;
		case R.id.rl_hienthi:
			gotoCaidatHienthi();
			break;
		case R.id.rl_chung:
			gotoCaidatChung();
			break;

		default:
			break;
		}
	}
	
	
	void gotoCaidatThongtinCanhan(){
		MainActivity.onGoto = true;
		Intent t = new Intent(CaidatmoiActivity.this, ThongtincanhanActivity.class);
		startActivity(t);
		CaidatmoiActivity.this.overridePendingTransition(R.anim.trans_left_in, R.anim.over_main_left);
	}
	void gotoCaidatThongbao(){
		MainActivity.onGoto = true;
		Intent t = new Intent(CaidatmoiActivity.this, ThongbaoActivity.class);
		startActivity(t);
		overridePendingTransition(R.anim.trans_left_in, R.anim.over_main_left);
	}
	void gotoCaidatHienthi(){
		MainActivity.onGoto = true;
		Intent t = new Intent(CaidatmoiActivity.this, HienthiActivity.class);
		startActivity(t);
		overridePendingTransition(R.anim.trans_left_in, R.anim.over_main_left);
	}
	void gotoCaidatChung(){
		MainActivity.onGoto = true;
		Intent t = new Intent(CaidatmoiActivity.this, ChungActivity.class);
		startActivity(t);
		overridePendingTransition(R.anim.trans_left_in, R.anim.over_main_left);
	}
	
	
}
